package com.lgy.enums;

/**
 * 1：申请中 2：已完成 3：驳回
 */
public enum LeaveStatusEnum {
    APPLY(1, "申请中"), FINISH(2, "已完成"), REJECT(3, "驳回");
    private Integer status;
    private String name;

    LeaveStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public static String getLeaveStatus(int status) {
        for(LeaveStatusEnum leaveStatusEnum : LeaveStatusEnum.values()) {
            if(leaveStatusEnum.getStatus().intValue() == status) {
                return leaveStatusEnum.getName();
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
